<html>
<head><meta charset="utf-8"><title>broken compilation to ptx · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/broken.20compilation.20to.20ptx.html">broken compilation to ptx</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="240628352"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/broken%20compilation%20to%20ptx/near/240628352" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Riccardo D&#x27;Ambrosio <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/broken.20compilation.20to.20ptx.html#240628352">(May 28 2021 at 16:28)</a>:</h4>
<p>Hello!</p>
<p>I was just wondering why rustc often makes broken ptx when targeting <code>nvptx64-nvidia-cuda</code>. Is this a case of rustc giving llvm wrong IR for ptx or the LLVM PTX backend just being broken? If it worked it would be wonderful to be able to write cuda kernels in rust. If this is a case of llvm being broken, couldnt there be a custom rustc backend that targets NVVM IR? the IR that NVCC uses, which is just a subset of LLVM IR</p>



<a name="240629864"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/broken%20compilation%20to%20ptx/near/240629864" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Riccardo D&#x27;Ambrosio <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/broken.20compilation.20to.20ptx.html#240629864">(May 28 2021 at 16:41)</a>:</h4>
<p>also, on the targets site, why does it say nvptx has full std available? compiling the stdlib for the gpu doesnt really make sense <span aria-label="joy" class="emoji emoji-1f602" role="img" title="joy">:joy:</span></p>



<a name="240634406"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/broken%20compilation%20to%20ptx/near/240634406" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/broken.20compilation.20to.20ptx.html#240634406">(May 28 2021 at 17:16)</a>:</h4>
<p>the std checkmark was a mistake, posted <a href="https://github.com/rust-lang/rust/pull/85790">https://github.com/rust-lang/rust/pull/85790</a> to fix it.</p>



<a name="240635502"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/broken%20compilation%20to%20ptx/near/240635502" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Riccardo D&#x27;Ambrosio <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/broken.20compilation.20to.20ptx.html#240635502">(May 28 2021 at 17:25)</a>:</h4>
<p>ah ok, that makes more sense lol</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>